package remoteControl;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashMap;

public class MyProtocol {
	BufferedReader in; PrintWriter out;
	 HashMap<String,String> hm;
	 public MyProtocol(BufferedReader in, PrintWriter out){
	  this.in=in; this.out=out;
	  hm=new HashMap<String,String>();
	  hm.put("hello", "world!");
	  hm.put("Alice", "Bob!");
	  hm.put("Exit", "bye!");
	 }
	 public String run(){
	  String request="",response="";
	  try {
	  //while(!request.startsWith("done")){
	   request=in.readLine();
	   //response=hm.get(request);
	   if(response!=null) out.println("ok");
	   else out.println("?");
	   //}
	   } catch (IOException e) {}
	   return request;
	 }
}

